<div class="bs-callout bs-callout-info">
    <h4>Edit Faq</h4>
    <p><a href="<?php echo base_url()?>admin/faq">+ Back</a></p>
</div>

<form class="form-horizontal" role="form" method="POST">    
    <div class="form-group">
        <label for="languageCode" class="col-sm-8 control-label">Language</label>
        <div class="col-sm-4">
            <select id="languageCode" name="languageCode" class="form-control" onchange = "redirectlink('<?php echo base_url()."admin/faq/editLanguage/".$data['faqId'].'/';?>'+ this.value);" >
                <?php
                    foreach($languages as $key=>$value){
                ?>
                <option value="<?php echo $value['languageCode']?>" <?php if($value['languageCode'] == $data['languageCode']) echo 'selected';?> ><?php echo $value['languageName']?></option>
                <?php
                    }
                ?>
            </select>
        </div>
    </div>
    
    <div class="form-group">
        <label for="question" class="col-sm-2 control-label">Question</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="question" placeholder="Question" name="question" required="true" value="<?php echo $data['question'];?>" />
        </div>
    </div>
    
    <div class="form-group">
        <label for="slug" class="col-sm-2 control-label">Slug</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="slug" placeholder="Slug" name="slug" required="true" value="<?php echo $data['slug'];?>" />
        </div>
    </div>
    
    <div class="form-group">
        <label for="answer" class="col-sm-2 control-label">Answer</label>
        <div class="col-sm-10">
            <textarea class="form-control" id="answer" placeholder="Answer" name="answer" required="true"><?php echo $data['answer'];?></textarea>
        </div>
    </div>
    
    <div class="form-group">
        <label for="number" class="col-sm-2 control-label">Number</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="number" placeholder="Number" name="number" required="true" value="<?php echo $data['number'];?>" />
        </div>
    </div>
    
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-primary">Save</button>
        </div>
    </div>
</form> 
<script type="text/javascript">
function redirectlink(url){
    window.location.href=url;
}
</script>